package com.opensource.component.api;

import com.opensource.component.register.RegisterInterfaceStatement;
import com.opensource.component.register.RegisterStatementManager;
import com.opensource.component.register.RegisterStatementRpcClient;
import java.util.List;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通过feign调用到申报服务上报
 *
 * @author ZonLen since on 2022/5/30 下午8:58
 */
@RestController
public final class RegisterStatementProvider implements
    RegisterStatementRpcClient {

  public void registerInterfaceStatements(
      @RequestBody List<RegisterInterfaceStatement> registerInterfaceStatements) {
    for (RegisterInterfaceStatement registerInterfaceStatement : registerInterfaceStatements) {
      RegisterStatementManager.register(registerInterfaceStatement);
    }
  }
}
